package defaulPackage;

public class Photo extends File {
	private int height;
	private int width;
	
	public Photo(String name, int date, int width, int height) {
		super(name, date);
		this.width = width;
		this.height = height;
	}
	
	public int getWidth() {
		return width;
	}
	
	public int getHeight() {
		return height;
	}
	
	@Override
	public boolean match(File file) {
		if (!super.match(file)) return false;
		if (!(file instanceof Photo)) return false;
		if (width != ((Photo) file).getWidth()) return false;
		if (height != ((Photo) file).getHeight()) return false;
		return true;
	}

}
